package com.cloud.school.bus.teacherhelper.protocol.classmanage;

import org.apache.http.Header;
import org.json.JSONObject;

import com.cloud.school.bus.teacherhelper.entitys.Student;
import com.cloud.school.bus.teacherhelper.protocol.baseresponse.BaseJsonHttpResponse;

public class RelationShipResponse extends BaseJsonHttpResponse {

	protected Student student = new Student();

	@Override
	public void onSuccess(int statusCode, Header[] headers,
			String responseString) throws Throwable {
		if ("1".equals(code)) {
			JSONObject mainJsonObject = new JSONObject(responseString);
			JSONObject studentJsonObject = mainJsonObject
					.optJSONObject("student");
			if (null != studentJsonObject) {
				student.parentid = studentJsonObject.optString("parentid", "");
				student.username = studentJsonObject.optString("username", "");
				student.mobile = studentJsonObject.optString("mobile", "");
				student.studentid = studentJsonObject.optString("studentid", "");
				student.birthday = studentJsonObject.optString("birthday", "");
				student.studentno = studentJsonObject.optString("studentno", "");
				student.uid_student = studentJsonObject.optString("uid_student", "");
				student.cnname = studentJsonObject.optString("cnname", "");
				student.enname = studentJsonObject.optString("enname", "");
				student.avatar = studentJsonObject.optString("avatar", "");
				student.filesize = studentJsonObject.optString("filesize", "");
				student.sex = studentJsonObject.optString("sex", "");
				student.orderendtime = studentJsonObject.optString("orderendtime", "");
				student.age = studentJsonObject.optString("age", "");
			}
		}
	}

}
